import React, { Component, Fragment } from "react";
import store from "./store";
import { Provider } from "react-redux";
import { BrowserRouter, Route } from "react-router-dom";

// 组件
import Header from "./common/header";
import Home from "./pages/home/index";
import Detail from "./pages/detial/loadable.js";
import Login from "./pages/login/index";
import Write from "./pages/home/index";

class App extends Component {
    render() {
        return (
            <Provider store={store}>
                <BrowserRouter>
                    <Fragment>
                        <Header />
                        <Route path="/" exact component={Home} />
                        <Route path="/login" exact component={Login} />
                        <Route path="/write" exact component={Write} />
                        <Route path="/detail/:id" exact component={Detail} />
                    </Fragment>
                </BrowserRouter>
            </Provider>
        );
    }
}

export default App;
